import request from '@/utils/request'

// 获取交易页信息
export const reqGetTradeInfo = () => {
  return request({
    method: 'get',
    url: '/order/auth/trade',
  })
}
// 提交订单
export const reqSubmitOrder = ({ tradeNo, ...data }) => {
  return request({
    method: 'post',
    url: '/order/auth/submitOrder',
    params: {
      // 携带query查询字符串参数
      tradeNo,
    },
    data, // 携带请求体参数
  })
}

// 获取二维码
export const reqGetPayQRCode = (orderId) => {
  return request({
    method: 'get',
    url: `/payment/weixin/createNative/${orderId}`,
  })
}

// 查询订单状态

export const reqQueryPayStatus = (orderId) => {
  return request({
    method: 'get',
    url: `/payment/weixin/queryPayStatus/${orderId}`,
  })
}
